@charset "utf-8";

// 色调
$activeColor: #17622B;
$activeColor2: #B7D31B;

$color: #17622B;
$color1: #17622B;
$color2: #B7D31B;

// 默认字体
$font: "SF Pro SC", "HanHei SC", "SF Pro Text", "Myriad Set Pro", "PingFang SC",
"Helvetica Neue", "microsoft yahei", "Microsoft YaHei", SimHei, sans-serif;

// 线性渐变(deg, start-color, end-color);
@mixin linearGradient($deg: -120deg, $rgba: $color1, $rgba2: $color2) {
  background: -webkit-linear-gradient($deg, $rgba, $rgba2);
  background: -o-linear-gradient($deg, $rgba, $rgba2);
  background: -moz-linear-gradient($deg, $rgba, $rgba2);
  background: linear-gradient($deg, $rgba, $rgba2);
}

// 设置字体尺寸,颜色(size, color, font-family);
@mixin font($value, $value2, $value3: $font) {
  font-family: $value3;
  font-size: $value;
  color: $value2;
}

// 水平居中(position || transform)
@mixin horizontal($type: position) {
  @if $type == position {
    position: absolute;
    left: 0;
    right: 0;
    margin: 0 auto;
  }
  @if $type == transform {
    position: relative;
    left: 50%;
    @include x(-50%);
  }
}

// 垂直居中(position || transform)
@mixin vertical($type: position) {
  @if $type == position {
    position: absolute;
    top: 0;
    bottom: 0;
    margin: auto 0;
  }
  @if $type == transform {
    position: relative;
    top: 50%;
    @include y(-50%);
  }
}

// 整体居中(position || transform)
@mixin center($type: position) {
  @if $type == position {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
  }
  @if $type == transform {
    position: relative;
    top: 50%;
    left: 50%;
    @include transform(translateX(-50%) translateY(-50%));
  }
}

// 过渡(时间,动画方式)
@mixin transition($value: 0.35s, $value2: ease) {
  transition: $value;
  -moz-transition: $value;
  -webkit-transition: $value;
  -o-transition: $value;
  transition-timing-function: $value2;
  -moz-transition-timing-function: $value2; /* Firefox 4 */
  -webkit-transition-timing-function: $value2; /* Safari 和 Chrome */
  -o-transition-timing-function: $value2; /* Opera */
}

// 转换transform
@mixin transform($value) {
  transform: $value;
  -ms-transform: $value;
  -moz-transform: $value;
  -webkit-transform: $value;
  -o-transform: $value;
}

// y轴平移
@mixin y($value) {
  transform: translateY($value);
  -ms-transform: translateY($value);
  -moz-transform: translateY($value);
  -webkit-transform: translateY($value);
  -o-transform: translateY($value);
}

// x轴平移
@mixin x($value) {
  transform: translateX($value);
  -ms-transform: translateX($value);
  -moz-transform: translateX($value);
  -webkit-transform: translateX($value);
  -o-transform: translateX($value);
}

// 缩放
@mixin scale($value) {
  transform: scale($value);
  -ms-transform: scale($value);
  -moz-transform: scale($value);
  -webkit-transform: scale($value);
  -o-transform: scale($value);
}

// 旋转(deg)
@mixin rotate($value) {
  transform: rotate($value);
  -ms-transform: rotate($value);
  -moz-transform: rotate($value);
  -webkit-transform: rotate($value);
  -o-transform: rotate($value);
}

// 3D旋转
@mixin rotate3d($val1: 1, $val2: 1, $val3: 1, $value: 360deg) {
  transform: rotate3d($val1, $val2, $val3, $value);
  -ms-transform: rotate3d($val1, $val2, $val3, $value);
  -moz-transform: rotate3d($val1, $val2, $val3, $value);
  -webkit-transform: rotate3d($val1, $val2, $val3, $value);
  -o-transform: rotate3d($val1, $val2, $val3, $value);
}

// 动画曲线
@mixin animateFunction($value1: ease) {
  transition-timing-function: $value1;
  -moz-transition-timing-function: $value1; /* Firefox 4 */
  -webkit-transition-timing-function: $value1; /* Safari 和 Chrome */
  -o-transition-timing-function: $value1; /* Opera */
}

// 清除浮动引发的bug
@mixin clear {
  *zoom: 1;
  &:before,
  &:after {
    content: " ";
    display: table;
  }
  &:after {
    clear: both;
  }
}

// 宽高,disblock
@mixin a {
  width: 100%;
  height: 100%;
  display: block;
}

// placeholder的样式(input || textarea, font-size, color, font-weight)
@mixin placeholder($type, $value, $value2, $value3: "normal", $value4: M) {
  @if $type == input {
    input::-webkit-input-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
      font-family: $value4;
    }
    input:-moz-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
      font-family: $value4;
    }
    input::-moz-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
      font-family: $value4;
    }
    input:-ms-input-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
      font-family: $value4;
    }
  }
  @if $type == textarea {
    textarea::-webkit-input-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
      font-family: $value4;
    }
    textarea:-moz-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
      font-family: $value4;
    }
    textarea::-moz-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
      font-family: $value4;
    }
    textarea:-ms-input-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
      font-family: $value4;
    }
  }
}

// 三角
@mixin arrow($direction, $size, $color) {
  width: 0;
  height: 0;
  line-height: 0;
  font-size: 0;
  overflow: hidden;
  border-width: $size;
  cursor: pointer;
  @if $direction == top {
    border-style: dashed dashed solid dashed;
    border-color: transparent transparent $color transparent;
    border-top: none;
  } @else if $direction == bottom {
    border-style: solid dashed dashed dashed;
    border-color: $color transparent transparent transparent;
    border-bottom: none;
  } @else if $direction == right {
    border-style: dashed dashed dashed solid;
    border-color: transparent transparent transparent $color;
    border-right: none;
  } @else if $direction == left {
    border-style: dashed solid dashed dashed;
    border-color: transparent $color transparent transparent;
    border-left: none;
  }
}

// object-fit
@mixin fit($value: cover) {
  -o-object-fit: $value;
  object-fit: $value;
  -o-object-position: center;
  object-position: center;
  width: 100%;
  height: 100%;
}

// 超出内容省略号
@mixin elli {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
